import request from '@/utils/request'

// 创建巡检任务
export function createPollingTask(data) {
  return request({
    url: '/abu/polling-task/create',
    method: 'post',
    data: data
  })
}

// 更新巡检任务
export function updatePollingTask(data) {
  return request({
    url: '/abu/polling-task/update',
    method: 'put',
    data: data
  })
}

// 删除巡检任务
export function deletePollingTask(id) {
  return request({
    url: '/abu/polling-task/delete?id=' + id,
    method: 'delete'
  })
}

// 获得巡检任务
export function getPollingTask(id) {
  return request({
    url: '/abu/polling-task/get?id=' + id,
    method: 'get'
  })
}

// 获得巡检任务分页
export function getPollingTaskPage(query) {
  return request({
    url: '/abu/polling-task/page',
    method: 'get',
    params: query
  })
}

// 导出巡检任务 Excel
export function exportPollingTaskExcel(query) {
  return request({
    url: '/abu/polling-task/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
